package edu.gdkm.extendsdemo;

public class Student extends Person{
    private String major;

    public String getMajor() {
        return major;
    }

    public void setMajor(String major) {
        this.major = major;
    }

    //多态：方法的覆盖
    public void say(){
//        super.say();
//        System.out.println("专业："+this.getMajor());
       System.out.println("Id："+ this.getId() +"，姓名："+this.getName()+"，专业："+this.getMajor());

    }
    public void study(){
        System.out.println("我在"+this.getMajor()+"专业快乐的学习中");
    }
    public void introduction(){
        System.out.println("----------------------------");
        System.out.println("大家好！我是一名学生！");
        super.say();
        System.out.println("----------------------------");
    }
}
